<extend name="layout/admin" />
<block name="title">商品添加</block>
<block name="content">
<script src="__PUBLIC__/Admin/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/ueditor/lang/zh-cn/zh-cn.js"></script>
	<div class="row">
		<div class="col-lg-12">
			<div class="panel panel-default">
				<div class="panel-heading">商品添加</div>
				<div class="panel-body">
					<div class="col-md-10 col-md-offset-2">
						<form role="form" action="__URL__/update" enctype="multipart/form-data" method="post">
							<div class="form-group">
								<label>商品分类</label>
								<select class="form-control" name="pid">
									<foreach name="res2" item="vo">
										<option value="{$vo.id}">&nbsp;{$vo.name}</option>
									</foreach>
								</select>
							</div>

							<div class="form-group">
								<label>商品名称</label>
								<input class="form-control" value={$res.gname} type="text" name="gname">
							</div>

							<div class="form-group">
								<label>商品编号</label>
								<input class="form-control" value="{$res.gid}" type="text" name="gid">
							</div>

							<div class="form-group">
								<label>通宝价</label>
								<input class="form-control" value="{$res.pv}" type="text" name="pv">
							</div>

							<div class="form-group">
								<label>商品图片</label>
								<input type="file" name="pic" value={$res.pic}><img src="__ROOT__/Public/Uploads/goods/{$res.pic}" alt="">
							</div>

							<div class="form-group">
								<label>商品描述</label>
								<script id="editor1" name="desc" type="text/plain" style="width:700px;height:100px;">{$res.desc}</script>
							</div>

							<div class="form-group">
								<label>商品特点</label>
								<script id="editor2" name="special" type="text/plain" style="width:700px;height:100px;">{$res.special}</script>
							</div>

							<div class="form-group">
								<label>注意事项</label>
								<script id="editor3" name="notice" type="text/plain" style="width:700px;height:100px;">{$res.notice}</script>
							</div>
							
							<div class="form-group">
								<label>商品状态</label>
								<div class="radio">
									<label>
										<input name="status" id="optionsRadios1" value="1" type="radio" <if condition="$res.status eq 1">checked</if>>上架
									</label>
								</div>
								<div class="radio">
									<label>
										<input name="status" id="optionsRadios2" value="2" type="radio" <if condition="$res.status eq 2">checked</if>>下架
									</label>
								</div>
							</div>

							<div class="form-group">
								<label>库存</label>
								<input class="form-control" placeholder="请输入商品库存" type="number" name="repertory" value="{$res.repertory}">
							</div>

							<div class="form-group">
								<label>销量</label>
								<input class="form-control" placeholder="请输入商品销量" type="number" name="sales" value="{$res.sales}">
							</div>

					       	<input type="hidden" value="{$res.id}" name="id">
							<button type="submit" class="btn btn-primary">提交</button>
							<button type="reset" class="btn btn-default">取消</button>
						</form>
					</div>
				</div>
			</div>
		</div><!-- /.col-->
	</div>
	<script type="text/javascript">
		$(function(){
		     var ue1 = UE.getEditor('editor1');
		     var ue2 = UE.getEditor('editor2');
		     var ue3 = UE.getEditor('editor3');
		});
	</script>
</block>